function bind() {
    $('p').click(function () {
        var p = $("input[type='radio'][name='optionsRadios']:checked").val();
        // window.open(p + $(this).attr('f'));
        window.open(p + $(this).attr('f'), '_self');
    });
}
var tvdata = '/tvdata.json';
$(document).ready(function () {
    $.ajax({
        type: "GET",
        url: tvdata,
        data: "{}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        cache: false,
        success: function (data) {
            var tvHTML = '';

            $.each(data.tvSeries, function (i, tv) {
                ///*
                tvHTML += '<div class="jumbotron mt-3">' +
                    ' <div class="row"><div class="col-md-4 "><h2 class="text-center">' + tv.name + '</h2><img src="' + tv.photo +
                    '" class="img-thumbnail center-block" alt="Image"></br> </div> <div class="col-md-8 ">' 
                //*/
                // tvHTML += '<div class="jumbotron mt-3"><div class="row">'

                $.each(tv.episode, function (j, epi) {
                    ///*

                    tvHTML += '<div class="col-lg-3">' +
                        '<p class="btn btn-lg btn-primary btn-block" role="button" f="' +
                        epi.episodeUrl + '">' + epi.episodeNumber +
                        '</p>' + '</div>'
                    //*/
                    /*
                    tvHTML += '<div class="col-lg-2">' +
                        '<p class="btn btn-lg btn-primary" role="button" f="' +
                        epi.episodeUrl + '">' + epi.episodeNumber +
                        '</p>' + '</div>'
                    */

                });
                tvHTML += '</div></div></div>'
                //tvHTML += '</div></div>'


            });

            $('#mytv').append(tvHTML);
            bind();

        },

        error: function (msg) {

            alert(msg.responseText);
        }
    });
})